﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using WebApplication6.DAL.DataSetDingdanTableAdapters;
using WebApplication6.DAL.DataSetProductTableAdapters;

namespace WebApplication6.manage
{
    public partial class dingdan : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string action = Request["action"];



                if (action == "show")
                {
                    Label1.Text = "查看明细";

                    string id = Request["id"];
                    t_dingdanTableAdapter adapter = new t_dingdanTableAdapter();

                    var rows = adapter.GetDataByid(Convert.ToInt32(id)).Single();

                    Label2.Text = rows.mingxi;


                }
                else if (action == "del")
                {
                    string id = Request["id"];

                    t_dingdanTableAdapter adapter = new t_dingdanTableAdapter();

                    var rows = adapter.GetDataByid(Convert.ToInt32(id)).Single();

                    rows.zhuangtai = "已处理";

                    adapter.Update(rows);


                    Response.Write("<script language=javascript>alert('操作成功');window.location.href='dingdanlist.aspx';</script>");

                }


                else
                {

                    throw new Exception("action错误" + action);
                }
            }
        }
    }
}
